package vn.fpt.fsoft.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/*
 * Entity.
 *
 * Version 1.0
 *
 * 22-August-2014
 *
 * Modification Logs:
 * DATE                 AUTHOR              DESCRIPTION
 * --------------------------------------------------------
 * 22-August-2014       NguyenTuyen          GovOfficeRegion
 */
@Entity
public class GovOfficeRegion implements java.io.Serializable {
    
    /**
     * Serial version.
     */
    private static final long serialVersionUID = 1L;
    
    /**
     * 
     * Government office region id.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "GovOfficeRegionID", nullable = false)
    private int govOfficeRegionID;
    
    /**
     * Government office region name.
     */
    @Column(name = "GovOfficeRegionName", nullable = false, length = 45)
    private String govOfficeRegionName;
    
    /**
     * Description.
     */
    @Column(name = "Description", nullable = true, length = 300)
    private String description;
    
    /**
     * CountryID.
     */
    @Column(name = "CountryID", nullable = true)
    private int countryID;
    
    /**
     * Is active.
     */
    @Column(name = "IsActive", nullable = true)
    private boolean isActive;
    
    /**
     * Mapping with county.
     */
    @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name = "CountyID")
    private County county;
    
    /**
     * Constructor default.
     */
    public GovOfficeRegion() {
        
    }
    
    /**
     * Constructor with param.
     * 
     * @param govOfficeRegionName
     * @param description
     * @param isActive
     * @param county
     */
    public GovOfficeRegion(String govOfficeRegionName, String description,
            boolean isActive, County county) {
        this.govOfficeRegionName = govOfficeRegionName;
        this.description = description;
        this.isActive = isActive;
        this.county = county;
    }
    
    /**
     * Constructor with all param.
     * 
     * @param govOfficeRegionID
     * @param govOfficeRegionName
     * @param description
     * @param isActive
     * @param county
     * @param countryID
     */
    public GovOfficeRegion(int govOfficeRegionID, String govOfficeRegionName,
            String description, boolean isActive, County county, int countryID) {
        this.govOfficeRegionID = govOfficeRegionID;
        this.govOfficeRegionName = govOfficeRegionName;
        this.description = description;
        this.isActive = isActive;
        this.county = county;
        this.countryID = countryID;
    }
    
    /**
     * Get office region id.
     * 
     * @return
     */
    public int getGovOfficeRegionID() {
        return govOfficeRegionID;
    }
    
    /**
     * Set office region id.
     */
    public void setGovOfficeRegionID(int govOfficeRegionID) {
        this.govOfficeRegionID = govOfficeRegionID;
    }
    
    /**
     * Get office region name.
     * 
     * @return
     */
    public String getGovOfficeRegionName() {
        return govOfficeRegionName;
    }
    
    /**
     * Set office region name.
     * 
     * @param govOfficeRegionName
     */
    public void setGovOfficeRegionName(String govOfficeRegionName) {
        this.govOfficeRegionName = govOfficeRegionName;
    }
    
    /**
     * Get description.
     * 
     * @return
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * Set description.
     * 
     * @param description
     */
    public void setDescription(String description) {
        this.description = description;
    }
    
    /**
     * Is active.
     * 
     * @return
     */
    public boolean isActive() {
        return isActive;
    }
    
    /**
     * Set active.
     * 
     * @param isActive
     */
    public void setActive(boolean isActive) {
        this.isActive = isActive;
    }
    
    /**
     * Get county.
     * 
     * @return
     */
    public County getCounty() {
        return county;
    }
    
    /**
     * Set county.
     * 
     * @param county
     */
    public void setCounty(County county) {
        this.county = county;
    }
    
    /**
     * Get countryID.
     * 
     * @return
     */
    public int getCountryID() {
        return countryID;
    }
    
    /**
     * Set countryID.
     * 
     * @param countryID
     */
    public void setCountryID(int countryID) {
        this.countryID = countryID;
    }
    
}
